11 research outputs found
A Verified Software Toolchain for Quantum Programming
Quantum computing is steadily moving from theory into practice, with small-scale quantum computers available for public use. Now quantum programmers are faced with a classical problem: How can they be sure that their code does what they intend it to do? I aim to show that techniques for classical program verification can be adapted to the quantum setting, allowing for the development of high-assurance quantum software, without sacrificing performance or programmability. In support of this thesis, I present several results in the application of formal methods to the domain of quantum programming, aiming to provide a high-assurance software toolchain for quantum programming. I begin by presenting SQIR, a small quantum intermediate representation deeply embedded in the Coq proof assistant, which has been used to implement and prove correct quantum algorithms such as Grover’s search and Shor’s factorization algorithm. Next, I present VOQC, a verified optimizer for quantum circuits that contains state-of-the-art SQIR program optimizations with performance on par with unverified tools. I additionally discuss VQO, a framework for specifying and verifying oracle programs, which can then be optimized with VOQC. Finally, I present exploratory work on providing high assurance for a high-level industry quantum programming language, Q#, in the F* proof assistant
Formal Verification vs. Quantum Uncertainty
Quantum programming is hard: Quantum programs are necessarily probabilistic and impossible to examine without disrupting the execution of a program. In response to this challenge, we and a number of other researchers have written tools to verify quantum programs against their intended semantics. This is not enough. Verifying an idealized semantics against a real world quantum program doesn\u27t allow you to confidently predict the program\u27s output. In order to have verification that works, you need both an error semantics related to the hardware at hand (this is necessarily low level) and certified compilation to the that same hardware. Once we have these two things, we can talk about an approach to quantum programming where we start by writing and verifying programs at a high level, attempt to verify properties of the compiled code, and repeat as necessary
Quantitative Robustness Analysis of Quantum Programs (Extended Version)
Quantum computation is a topic of significant recent interest, with practical
advances coming from both research and industry. A major challenge in quantum
programming is dealing with errors (quantum noise) during execution. Because
quantum resources (e.g., qubits) are scarce, classical error correction
techniques applied at the level of the architecture are currently
cost-prohibitive. But while this reality means that quantum programs are almost
certain to have errors, there as yet exists no principled means to reason about
erroneous behavior. This paper attempts to fill this gap by developing a
semantics for erroneous quantum while-programs, as well as a logic for
reasoning about them. This logic permits proving a property we have identified,
called -robustness, which characterizes possible "distance" between
an ideal program and an erroneous one. We have proved the logic sound, and
showed its utility on several case studies, notably: (1) analyzing the
robustness of noisy versions of the quantum Bernoulli factory (QBF) and quantum
walk (QW); (2) demonstrating the (in)effectiveness of different error
correction schemes on single-qubit errors; and (3) analyzing the robustness of
a fault-tolerant version of QBF.Comment: 34 pages, LaTeX; v2: fixed typo
Q# as a Quantum Algorithmic Language
Q# is a standalone domain-specific programming language from Microsoft for
writing and running quantum programs. Like most industrial languages, it was
designed without a formal specification, which can naturally lead to ambiguity
in its interpretation. We aim to provide a formal language definition for Q#,
placing the language on a solid mathematical foundation and enabling further
evolution of its design and type system. This paper presents -Q#, an
idealized version of Q# that illustrates how we may view Q# as a quantum Algol
(algorithmic language). We show the safety properties enforced by
-Q#'s type system and present its equational semantics based on a
fully complete algebraic theory by Staton.Comment: In Proceedings QPL 2022, arXiv:2311.0837
Proving Quantum Programs Correct
As quantum computing progresses steadily from theory into practice,
programmers will face a common problem: How can they be sure that their code
does what they intend it to do? This paper presents encouraging results in the
application of mechanized proof to the domain of quantum programming in the
context of the SQIR development. It verifies the correctness of a range of a
quantum algorithms including Grover's algorithm and quantum phase estimation, a
key component of Shor's algorithm. In doing so, it aims to highlight both the
successes and challenges of formal verification in the quantum context and
motivate the theorem proving community to target quantum computing as an
application domain.Comment: version 4 updated DOI (paper content is the same); version 3 (final
version) has updated formatting and improved writing; version 2 includes
updated acknowledgments and a new appendix with simple SQIR example program
A formally certified end-to-end implementation of Shor’s factorization algorithm
Quantum computing technology may soon deliver revolutionary improvements in algorithmic performance, but it is useful only if computed answers are correct. While hardware-level decoherence errors have garnered significant attention, a less recognized obstacle to correctness is that of human programming errors—“bugs.” Techniques familiar to most programmers from the classical domain for avoiding, discovering, and diagnosing bugs do not easily transfer, at scale, to the quantum domain because of its unique characteristics. To address this problem, we have been working to adapt formal methods to quantum programming. With such methods, a programmer writes a mathematical specification alongside the program and semiautomatically proves the program correct with respect to it. The proof’s validity is automatically confirmed—certified—by a “proof assistant.” Formal methods have successfully yielded high-assurance classical software artifacts, and the underlying technology has produced certified proofs of major mathematical theorems. As a demonstration of the feasibility of applying formal methods to quantum programming, we present a formally certified end-to-end implementation of Shor’s prime factorization algorithm, developed as part of a framework for applying the certified approach to general applications. By leveraging our framework, one can significantly reduce the effects of human errors and obtain a high-assurance implementation of large-scale quantum applications in a principled way
FastVer2: A Provably Correct Monitor for Concurrent, Key-Value Stores
International audienceFastVer is a protocol that uses a variety of memory-checking techniques to monitor the integrity of key-value stores with only a modest runtime cost. Arasu et al. formalize the high-level design of FastVer in the F* proof assistant and prove it correct. However, their formalization did not yield a provably correct implementation---FastVer is implemented in unverified C++ code.In this work, we present FastVer2, a low-level, concurrent implementation of FastVer in Steel, an F* DSL based on concurrent separation logic that produces C code, and prove it correct with respect to FastVer's high-level specification. Our proof is the first end-to-end system proven using Steel, and in doing so we contribute new ghost-state constructions for reasoning about monotonic state. Our proof also uncovered a few bugs in the implementation of FastVer.We evaluate FastVer2 by comparing it against FastVer. Although our verified monitor is slower in absolute terms than the unverified code, its performance also scales linearly with the number of cores, yielding a throughput of more that 10M op/sec. We identify several opportunities for performance improvement, and expect to address these in the future